<?php
$process = new swoole_process(function (swoole_process $process) {
   $process->name("child progress");
   // 在这里用echo 和 write 一样都是将数据写到管道
   echo "====swoole_process===child==progress".PHP_EOL;
   $process->write("你好啊父进程，我是子进程===子进程id".$process->pid."\r\n");
   sleep(10);
},true);
//这个start相当于创建子进程，创建成功返回子进程的PID，创建失败返回false
echo $process->start();
echo $process->read();
$process->name("master progress");
$process->wait();